﻿using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Models.Common;
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using UtilsCache;
using UtilsORM;
using UtilsORM.MySqlData;

////using System.Web.Script.Serialization;

namespace ServiceWeb.DBGateway
{
    public class DBIotDeviceModelCache
    {
        EFYihongIotContext ef = new EFYihongIotContext();
        public List<iot_device_model> getDeviceModelListCache()
        {
            List<iot_device_model> list = UtilMemoryCacheHelper.StringGet<List<iot_device_model>>("deviceModelList");
            if (list == null)
            {
                list = ef.iot_device_model.Where(c => c.m_status == 0).ToList();
                UtilMemoryCacheHelper.StringSet("deviceModelList", list, 1);
            }
            return list;
          
        }


    }
}
